local M = {}

local cacheTable = {}
local loadedPath = {}

function M.init()

end

function M.release()
    do return end
    cacheTable = {};
    for _, path in pairs(loadedPath) do
        package.loaded[path] = nil;
    end
    loadedPath = {};
end

return setmetatable(M, {__call = function(t, relativePath)
    if cacheTable[relativePath] then
        return cacheTable[relativePath]
    end

    local fullPath = "club.threecard.gamelib."..relativePath;
    local ret = require (fullPath)
    if ret then
        cacheTable[relativePath] = ret;
        table.insert(loadedPath, fullPath);
    end

    return ret;
 end})